# SPDX-License-Identifier: MIT
# Copyright (C) 2021 Intel Corporation

file(READ "include/safe_lib.h" VER_FILE)

string(REGEX MATCH "SAFEC_VERSION_MAJOR ([0-9]*)" _ ${VER_FILE})
set(SAFEC_VERSION_MAJOR ${CMAKE_MATCH_1})

string(REGEX MATCH "SAFEC_VERSION_MINOR ([0-9]*)" _ ${VER_FILE})
set(SAFEC_VERSION_MINOR ${CMAKE_MATCH_1})

string(REGEX MATCH "SAFEC_VERSION_PATCH ([0-9]*)" _ ${VER_FILE})
set(SAFEC_VERSION_PATCH ${CMAKE_MATCH_1})

set(SAFEC_VERSION_STRING
    ${SAFEC_VERSION_MAJOR}.${SAFEC_VERSION_MINOR}.${SAFEC_VERSION_PATCH})
